package cn.wolfcode.controller;

import cn.wolfcode.domain.Result;
import cn.wolfcode.util.OSSUtils;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;
@Slf4j
@RestController
public class UploadController {
    @Autowired
    private OSSUtils ossUtils;
    @PostMapping("/upload")

    public Result upload(MultipartFile image) throws Exception {
        String upload=ossUtils.upload(image);
        return Result.success(upload);


    }
}
